
import smtplib
from email.mime.text import MIMEText
From = """costcalculator@gmail.com"""
UserName = """costcalculator"""
Password = """grogan123"""

def SendMessage(Message, EmailAddress, Subject):

    msg = MIMEText(Message)
    
    msg['Subject'] = Subject
    msg['From'] = From
    msg['To'] = EmailAddress
    
    # Send the message via our own SMTP server, but don't include the
    # envelope header.
    s=smtplib.SMTP('smtp.gmail.com')
    s.starttls()
    s.login(UserName, Password)
    s.sendmail(From, EmailAddress, msg.as_string())
    s.close()
    
def SendMultiple(Message, EmailAddresses, Subject):

    msg = MIMEText(Message)
    
    s=smtplib.SMTP('smtp.gmail.com')
    s.starttls()
    s.login(UserName, Password)
    
    msg['Subject'] = Subject
    msg['From'] = From
    for Address in EmailAddresses:
        msg['To'] = Address
        s.sendmail(From, Address, msg.as_string())
    s.close()
    
    
if __name__ == '__main__':
    SendMultiple("Hello Again", ["jamesdcollett@gmail.com", "jamesdcollett@gmail.com"], "hmm")